
#define TEMP0 (10)
#define TEMP1 (60)
#define ADC0 (297)
#define ADC1 (168)
#define ADCX (738)

typedef unsigned long unit32_t;
short int convert_adc2temperature(short int ax,short int a0,short int a1,short int temp0,short int temp1)
{
  short int tempx;
  tempx = temp0+(ax/2-a0)*(temp1-temp0)/(a1-a0);
  return tempx;
}


void setup() {
   Serial.begin(9600);

}

void loop() {
  int n = analogRead(A0);
  int tempx=convert_adc2temperature(ADCX,ADC0,ADC1,TEMP0,TEMP1);
  
  printf("ADC2Temperature ADC=%d,Temp.=%d",ADCX,tempx);

  delay (2000);

}
